<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<c:set value="${requestScope.response.data.one }" var="one" />
<jsp:useBean class="com.wangsh.splider.task.pojo.ATaskHistory" id="pojo"/>
<!DOCTYPE HTML>
<html>
<head>
	<%@ include file="/common/include/title.jsp"%>
	<title>更新历史 - 用户中心</title>
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页
	<span class="c-gray en">&gt;</span> 任务管理
	<span class="c-gray en">&gt;</span> 更新历史
	<a class="btn btn-success radius r"
	   style="line-height: 1.6em; margin-top: 3px"
	   href="javascript:location.replace(location.href);" title="刷新">
		<i class="Hui-iconfont">&#xe68f;</i>
	</a>
</nav>
<article class="page-container">
	<form class="form form-horizontal" id="formSubmit" action="${rootPath }/back/task/historyUpdateSubmit.htm">
		<input type="hidden" name="id" value="${one.id }">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span
				class="c-red">*</span>任务用户：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<span class="select-box">
					<select name="taskUsersId" class="select">
						<c:forEach items="${taskUsersResponse.data.list }" var="users" varStatus="stat">
							<option value="${users.id }" ${one.taskUsersId == users.id ? 'selected' : '' }>${users.email }</option>
						</c:forEach>
					</select>
				</span>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span
				class="c-red">*</span>IP：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<span class="select-box">
					<select name="ipId" class="select">
						<c:forEach items="${sysIpResponse.data.list }" var="ip" varStatus="stat">
							<option value="${ip.id }" ${one.ipId == ip.id ? 'selected' : '' }>${ip.ip }</option>
						</c:forEach>
					</select>
				</span>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span
				class="c-red">*</span>来源：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<span class="select-box">
					<select name="sysProId" class="select">
						<c:forEach items="${sysProResponse.data.list }" var="pro" varStatus="stat">
							<option value="${pro.id }" ${one.sysProId == pro.id ? 'selected' : '' }>${pro.name }</option>
						</c:forEach>
					</select>
				</span>
			</div>
		</div>
		<%-- <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">操作系统：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${one.os }" placeholder=""
					   id="os" name="os">
			</div>
		</div> --%>
		<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2">操作系统：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<select name="os">
							<option value="Windows">Windows</option>
							<option value="Mac OS">Mac OS</option>
							<option value="IOS">IOS</option>
							<option value="Android">Android</option>
							<option value="Other">Other</option>
						</select>
					</div>
		</div>
		<%-- <div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">浏览器：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${one.broswer }" placeholder=""
					   id="broswer" name="broswer">
			</div>
		</div> --%>
		<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2">浏览器：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<select name="broswer">
							<option value="Chrome">Chrome</option>
							<option value="IE">IE</option>
							<option value="Firefox">Firefox</option>
							<option value="Safari">Safari</option>
							<option value="Opera">Opera</option>
							<option value="Other">Other</option>
						</select>
					</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">发布时间：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" readonly="readonly" value="${one.pubTime}"
					   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
					   id="pubTimeStr" name="pubTimeStr" class="input-text Wdate">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">状态：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<c:forEach items="${pojo.enumsMap }" var="me" varStatus="stat">
					<c:if test="${fn:startsWith(me.key,'STATUS')}">
						<!-- 拆分,按照-拆分,取最后一个 -->
						<c:set value="${fn:split(me.key, '-')}" var="keys"/>
						<div class="radio-box">
							<label for="${me.key }">
								<input type="radio" id="${me.key }" name="status" value="${keys[1] }" ${keys[1] == one.status ? 'checked' : '' }>
								&nbsp;${me.value }
							</label>
						</div>
					</c:if>
				</c:forEach>
			</div>
		</div>
		<%--<div class="row cl">--%>
		<%--<label class="form-label col-xs-4 col-sm-2">内容：</label>--%>
		<%--<div class="formControls col-xs-8 col-sm-9">--%>
		<%--<script name="content" id="editor" type="text/plain"--%>
		<%--style="width: 100%; height: 200px;">${one.content}</script>--%>
		<%--</div>--%>
		<%--</div>--%>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button
						class="btn btn-primary radius" type="submit">
					<i class="Hui-iconfont">&#xe632;</i> 提交
				</button>
				<!-- <button onClick="article_save();" class="btn btn-secondary radius"
                    type="button">
                    <i class="Hui-iconfont">&#xe632;</i> 保存草稿
                </button>
                <button onClick="removeIframe();" class="btn btn-default radius"
                    type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button> -->
			</div>
		</div>
	</form>
</article>
<%@ include file="/common/include/footer.jsp" %>
<script type="text/javascript">
    $(function(){
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        //表单验证
        $("#formSubmit").validate({
            rules:{
                taskUsersId:{
                    required:true,
                    isDigits:true
                },
                ipId:{
                    required:true,
                    isDigits:true
                },
                sysProId:{
                    required:true,
                    isDigits:true
                },
            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type: 'post',
                    success: function(data){
                        /* 弹出框 */
                        layer.msg(data.info,{icon:1,time:3000},function()
                        {
                            if(data.code == '0')
                            {
                                //parent.$('.btn-refresh').click();
                                /* 刷新父窗口 */
                                window.parent.location.reload();
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.layer.close(index);
                            }
                        });
                    },
                    dataType:"json"
                });
            }
        });
        /* 初始化百度编辑器 */
        var ue = UE.getEditor('editor');
    });
</script>
</body>
</html>